﻿using System;
using System.Web.Mvc;
using System.Web.Routing;

namespace LambdaRouting {
    public static class RouteCollectionLambdaExtensions {
        public static void MapRoute(this RouteCollection self, string name, string url, Func<RequestContext, ActionResult> f) {
            self.Add(name, new LambdaRoute(url, f));
        }

        public static void MapRoute(this RouteCollection self, string name, string url, Func<ActionResult> f) {
            self.Add(name, new LambdaRoute(url, f));
        }

        /// <summary>
        /// Maps a function with parameter injection
        /// </summary>
        /// <typeparam name="T">parameter to be injected</typeparam>
        /// <param name="self"></param>
        /// <param name="name"></param>
        /// <param name="url"></param>
        /// <param name="d"></param>
        public static void MapRouteInject<T>(this RouteCollection self, string name, string url, Func<T, ActionResult> d) {
            throw new NotImplementedException();
        }

        public static void MapRouteInject<T, T2>(this RouteCollection self, string name, string url, Func<T, T2, ActionResult> d) {
            throw new NotImplementedException();
        }

        public static void MapRouteInject<T, T2, T3>(this RouteCollection self, string name, string url, Func<T, T2, T3, ActionResult> d) {
            throw new NotImplementedException();
        }

        public static void MapRouteInject<T, T2, T3, T4>(this RouteCollection self, string name, string url, Func<T, T2, T3, T4, ActionResult> d) {
            throw new NotImplementedException();
        }

    }
}